﻿@model EcrMenuModel
@using Nop.Web.Models.Common;
<div class="grey">
    <ul id="mega-menu" class="mega-menu">
        @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "header_menu_before" })
        <li><a href="@Url.RouteUrl("HomePage")">@T("HomePage")</a></li>
        <li><a href="#">Shop</a>
            @if (Model.Categories.Count > 0)
            {   
                <ul>
                    @foreach (var category in Model.Categories)
                    {
                        if(category.SubCategories.Count == 0)
                        {
                        <li><a href="@Url.RouteUrl("Category", new { categoryId = category.Id, SeName = category.SeName })">
                            @category.Name</a>
                           
                                @if (category.Products.Count > 0)
                                {
                                    <ul>
                                        @foreach (var prod in category.Products)
                                        {
                                            <li><a href="@Url.RouteUrl("Product", new { productID = prod.Id })">
                                                @prod.Name</a></li>
                                        }
                                    </ul>   
                                }
                        </li>
                        }
                    }
                </ul>
            }
        </li>
        @if (Model.RecentlyAddedProductsEnabled)
        {
            <li><a href="@Url.RouteUrl("RecentlyAddedProducts")">@T("Products.NewProducts")</a>
            </li>
        }
        <li><a href="@Url.RouteUrl("ProductSearch")">@T("Search")</a> </li>
        <li><a href="@Url.RouteUrl("CustomerInfo")">@T("Account.MyAccount")</a></li>
        @if (Model.BlogEnabled)
        {
            <li><a href="@Url.RouteUrl("Blog")">@T("Blog")</a></li>
        }
        @if (Model.ForumEnabled)
        {
            <li><a href="@Url.RouteUrl("Boards")">@T("Forum.Forums")</a></li>
        }
        <li><a href="@Url.RouteUrl("ContactUs")">@T("ContactUs")</a></li>
        @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "header_menu_after" })
    </ul>
</div>
